<?php

function tf_create_header_file() {
  global $thfr_css;

  $header_string = '<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo("charset"); ?>"/>
<title><?php wp_title("|",true,"right"); ?> <?php bloginfo("name"); ?></title>
<link rel="stylesheet" href="<?php bloginfo("stylesheet_url"); ?>" type="text/css" media="screen" />
<link rel="pingback" href="<?php bloginfo("pingback_url"); ?>"/>
<?php if ( is_singular() && get_option( "thread_comments" ) ) wp_enqueue_script( "comment-reply" ); ?>
<?php wp_head(); ?>
';

  # $output_string .= $thfr_css['customhead'];
  // head insert
  if ($thfr_css['codeinserts']['head']['global'] != '') { //$thfr_css['codeinserts']['head'][$thisTemplate . '-global'] == 'on' and 
    $header_string .= $thfr_css['codeinserts']['head']['global'];
  }

  /*
  if ($thfr_css['codeinserts']['head'][$thisTemplate . '-custom'] == 'on' and $thfr_css['codeinserts']['head'][$thisTemplate] != '') {
    $header_string .= $thfr_css['codeinserts']['head'][$thisTemplate];
  }
  */

  $header_string .= '
</head>
';

  return $header_string;
}

function tf_create_footer_file() {
  global $thfr_css;

  // bodybottom insert
  if ($thfr_css['codeinserts']['bodybottom']['global'] != '') { //$thfr_css['codeinserts']['bodybottom'][$thisTemplate . '-global'] == 'on' and 
    $output_string .= $thfr_css['codeinserts']['bodybottom']['global'];
  }

  /*
  if ($thfr_css['codeinserts']['bodybottom'][$thisTemplate . '-custom'] == 'on' and $thfr_css['codeinserts']['bodybottom'][$thisTemplate] != '') {
    $output_string .= $thfr_css['codeinserts']['bodybottom'][$thisTemplate];
  }
  */

  $output_string .= '
<?php wp_footer(); ?>
</body>
</html>
';

  return $output_string;
}

function tf_create_loop_file() {
  return tf_create_php_file_content('index');
}

?>